package service.temp.job.matching.poc.listingapi;

import feign.Headers;
import feign.RequestLine;
import service.temp.job.matching.poc.listingapi.dto.ListResult;
import service.temp.job.matching.poc.listingapi.dto.SearchCondition;
import service.temp.job.matching.poc.listingapi.dto.SearchItem;

import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * ListingSearchApi
 *
 * @author Chao Xiong (chxiong@coupang.com)
 */
public interface GalaxySearchApi {
    /**
     * https://api-forge.coupang.net/details?specId=5c4a7858b2b956002e050ea8
     */
    @RequestLine("POST /v2/providers/listing_api/apis/api/v1/galaxy/search")
    @Headers("Content-Type: application/json")
    ListResult search(@Nonnull SearchCondition condition);

    default List<SearchItem> searchItemByQuery(@Nonnull String query) {
//        return search(new SearchCondition(query)).getProducts();
        return new ArrayList<>();
    }
}
